//
//  LatestViewController.m
//  WANNA
//
//  Created by lanou3g on 16/5/5.
//  Copyright © 2016年 浮夸. All rights reserved.
//

#import "LatestViewController.h"
#import "HomePageController.h"
#import "BeautyController.h"
#import "FashionController.h"
#import "LifeController.h"
#import "MovementController.h"
#import "SneakersController.h"
#import "SCNavTabBarController.h"
#import "CK_MenuViewController.h"
#import "BoysController.h"
#import "GirlsController.h"
@interface LatestViewController ()<MenuClickDelegate>

@end

@implementation LatestViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  
    
    self.title = @"最新";
    
    [self derwer];
    [self scnvc];
    
}

- (void)derwer
{
    self.navigationController.navigationBar.translucent = NO;
    [CK_MenuViewController getMenuViewController].menuDelegate = self;
    [CK_MenuViewController getMenuViewController].menuArray = [@[@"NEW 最新",@"BOYS 男生资讯",@"GIRLS 女生资讯",@"VLDEO 视频",@"FEATURE 专题",@"WALLPAPER 壁纸"]mutableCopy];
    UIBarButtonItem *drawer = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"菜单"] style:(UIBarButtonItemStylePlain) target:self action:@selector(drawerAction:)];
    self.navigationItem.leftBarButtonItem = drawer;

}

- (void)scnvc
{
    HomePageController *homePageVC = [[HomePageController alloc]init];
    homePageVC.title = @"主页";
    
    FashionController *fashionVC = [[FashionController alloc]init];
    fashionVC.title = @"时尚";
    
    SneakersController *sneakersVC = [[SneakersController alloc]init];
    sneakersVC.title = @"球鞋";
    
    LifeController *lifeVC = [[LifeController alloc]init];
    lifeVC.title = @"生活";
    
    MovementController *moveVC = [[MovementController alloc]init];
    moveVC.title = @"运动";
    
    BeautyController *beautyVC = [[BeautyController alloc]init];
    beautyVC.title = @"美容";
    
    
    SCNavTabBarController *navcTBC = [[SCNavTabBarController alloc]init];
    navcTBC.subViewControllers = @[homePageVC,fashionVC,sneakersVC,lifeVC,moveVC,beautyVC];
    [navcTBC addParentController:self];
    
    
    

}


#pragma mark - 点击菜单抽屉
- (void)drawerAction:(UIBarButtonItem *)sender
{
    if ([CK_MenuViewController getMenuViewController].isShowing) {
        [[CK_MenuViewController getMenuViewController]hideLeftViewController];
    }else
    {
        [[CK_MenuViewController getMenuViewController]showLeftViewController];
    }
}


#pragma mark - 点击菜单项的代理

- (void)didClickMenuIndex:(NSInteger)index Title:(NSString *)title
{
    [self.navigationController popToRootViewControllerAnimated:NO];
    
    switch (index) {
        case 0:
        {
            
        }
            break;
        case 1:
        {
            BoysController *boyVC = [[BoysController alloc]init];
            [self.navigationController pushViewController:boyVC animated:YES];
        }
            break;
        case 2:
        {
            GirlsController *girlVC = [[GirlsController alloc]init];
            [self.navigationController pushViewController:girlVC animated:YES];
        }
            break;
        case 3:
        {
            
        }
            break;
        case 4:
        {
            
        }
            break;
        case 5:
        {
            
        }
            break;
   
        default:
            break;
    }
    
}















- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
